import Vue from 'vue';
import Vuex from 'vuex';
import mutations from './mutations'
import actions from './actions'

import home from './home';
import { getStore } from "@/common/util"

Vue.use(Vuex);

let modules = {
    ...home,
};

export default new Vuex.Store({
    state: {
        details: getStore('details') ? JSON.parse(getStore('details')) : null,
        size: getStore('size') || null,
        theme: getStore('theme') || 'light'
    },
    modules,
    actions,    // 根级别的 action
    mutations,  // 根级别的 mutations
    // 根级别的 getters
    getters: {
    }
})
